<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>个人中心</title>
    <meta name="_token" content="{{ csrf_token() }}"/>
    <link rel="stylesheet" href="/static/home/css/style.css">
    <link rel="stylesheet" href="/static/public/layui/css/layui.css">

    <script type="text/javascript" src="/static/public/layui/layui.js"></script>
</head>
<body>
{{--顶部--}}
@include('home/public/header')
<div class="main" style="margin-top: 10px">
    {{--        banner--}}
    <div class="center">
        <div class="pre-nav">
            <ul>

                @foreach($menus as $item)
                <li><a href="javascript:;" onclick="firemenu(this)" controller="{{ $item['controller'] }}" action="{{ $item['action'] }}"> {{ $item['title'] }}</a></li>

                @endforeach

            </ul>
        </div>
        <div class="pre-main" style="overflow-y: hidden">
            <iframe src="/home/per/gere" frameborder="0" style="width: 100%;height:100%" onload="resetIframeHeight(this)"></iframe>
        </div>
    </div>


</div>
@include('home/public/footer')
<script type="text/javascript">
    layui.use(['layer','element'], function(){
        layer = layui.layer;
        var element = layui.element;
        $ = layui.jquery;
    });
    // 点击菜单
    function firemenu(obj){

        var controller = $(obj).attr('controller');
        var action = $(obj).attr('action');
        var url = '/home/'+controller+'/'+action;

        $('.main iframe').attr('src',url);

    }
    //iframe 页面的高度
    function resetIframeHeight(obj){
        var leftHeight = parent.document.documentElement.clientHeight - 270;
        $('.pre-main').height(leftHeight);
    }

</script>

</body>
</html>
